package com.ml.mq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;

@EnableBinding(MatchSink.class)
public class SendService {
	
	@Autowired
	private MatchSink source;

	public void sendNewOrder(String msg) {
		source.outNewOrder().send(MessageBuilder.withPayload(msg).build());
	}
	
	public void sendCancelOrder(String msg) {
		source.outCancelOrder().send(MessageBuilder.withPayload(msg).build());
	}
}
